/*
 * Copyright 2025 The JA-SIG Collaborative. All rights reserved.
 * distributed with this file and available online at
 */
package com.lap.auth.application.menu.command;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

@Data
@Schema(description = "更新菜单命令")
public class UpdateMenuCmd {

  @Range(min = 0, max = Integer.MAX_VALUE, message = "{menu.parentId.range}")
  @Schema(description = "父菜单")
  private Integer parentId;

  @NotNull(message = "{menu.menuType.required}")
  @Range(min = -127, max = 128, message = "{menu.menuType.range}")
  @Schema(description = "菜单类型:0-菜单,1-Iframe,3-外链,4-目录,6-功能")
  private Integer menuType;

  @Length(max = 64, message = "{menu.name.max.length}")
  @Schema(description = "路由名称")
  private String name;

  @Length(max = 128, message = "{menu.path.max.length}")
  @Schema(description = "路由路径")
  private String path;

  @Length(max = 128, message = "{menu.component.max.length}")
  @Schema(description = "路由组件")
  private String component;

  @Length(max = 256, message = "{menu.redirect.max.length}")
  @Schema(description = "路由定向")
  private String redirect;

  @Length(max = 128, message = "{menu.auths.max.length}")
  @Schema(description = "权限码")
  private String auths;

  @NotNull(message = "{menu.rank.required}")
  @Range(min = -127, max = 128, message = "{menu.rank.range}")
  @Schema(description = "路由排序")
  private Integer rank;

  @NotBlank(message = "{menu.title.required}")
  @Length(max = 128, message = "{menu.title.max.length}")
  @Schema(description = "菜单名称")
  private String title;

  @Length(max = 256, message = "{menu.icon.max.length}")
  @Schema(description = "菜单图标")
  private String icon;

  @Length(max = 256, message = "{menu.extraIcon.max.length}")
  @Schema(description = "向右图标")
  private String extraIcon;

  @Length(max = 256, message = "{menu.enterTransition.max.length}")
  @Schema(description = "进场动画")
  private String enterTransition;

  @Length(max = 256, message = "{menu.leaveTransition.max.length}")
  @Schema(description = "离场动画")
  private String leaveTransition;

  @Length(max = 128, message = "{menu.activePath.max.length}")
  @Schema(description = "菜单激活")
  private String activePath;

  @Length(max = 256, message = "{menu.frameSrc.max.length}")
  @Schema(description = "Iframe链接")
  private String frameSrc;

  @NotNull(message = "{menu.frameLoading.required}")
  @Schema(description = "Iframe加载动画")
  private boolean frameLoading;

  @NotNull(message = "{menu.showLink.required}")
  @Schema(description = "是否显示菜单")
  private boolean showLink;

  @NotNull(message = "{menu.showParent.required}")
  @Schema(description = "是否显示父菜单")
  private boolean showParent;

  @NotNull(message = "{menu.keepAlive.required}")
  @Schema(description = "是否缓存页面")
  private boolean keepAlive;

  @NotNull(message = "{menu.hiddenTag.required}")
  @Schema(description = "是否隐藏标签")
  private boolean hiddenTag;

  @NotNull(message = "{menu.fixedTag.required}")
  @Schema(description = "是否固定标签页")
  private boolean fixedTag;
}
